export default {
  selectMenu(state, value) {
    if(value.name != 'home') {
      state.currentItem = value
      const result = state.tabList.findIndex(tab => tab.name === value.name)
      result === -1 ? state.tabList.push(value) : ''
    } else {
      state.currentItem = null
    }
  },
  closeTab(state, value) {
    const result = state.tabList.findIndex(tab => tab.name === value.name)
    state.tabList.splice(result, 1)
  },
  toggleCollapse(state) {
    state.isCollapse = !state.isCollapse
  }
}